package kr.saeildamil.androidforstudy2.ch23;

import kr.saeildamil.androidforstudy2.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;

public class TweenAnimationTest extends Activity {
	LinearLayout layout;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch23_tweenanimationtest);

		layout = (LinearLayout) findViewById(R.id.ch23_tweenanimationtest_layout);
	}

	public void mOnClick(View v) {
		Animation animation = null;
		switch (v.getId()) {
		case R.id.ch23_tweenanimationtest_translatebtn:
			animation = AnimationUtils.loadAnimation(this, R.anim.translate);
			break;
		case R.id.ch23_tweenanimationtest_rotatebtn:
			animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
			break;
		case R.id.ch23_tweenanimationtest_scalebtn:
			animation = AnimationUtils.loadAnimation(this, R.anim.scale);
			break;
		case R.id.ch23_tweenanimationtest_alphabtn:
			animation = AnimationUtils.loadAnimation(this, R.anim.alpha);
			break;
		case R.id.ch23_tweenanimationtest_setbtn:
			animation = AnimationUtils.loadAnimation(this, R.anim.set);
			break;
		}
		layout.startAnimation(animation);
	}

}
